package cn.buk.tms.eotms.dto;

import cn.buk.tms.common.dto.base.BaseDto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;

import java.util.Date;

/**
 *
 * @author yfdai
 * @date 2015-3-17
 */
public class DtoLoginStatus extends BaseDto {

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String desc;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String username;

    @JsonIgnore
    private String password;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String fullName;

    @JsonIgnore
    private Integer enterpriseId;

    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String token;

    @JsonIgnore
    private Integer userId;

    /**
     * 携程联盟的站点ID
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private String sid;


    /**
     * 过期日期
     */
//    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Date expireDate;

    /**
     * 还剩余的过期天数
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer expireDays;

    /**
     * 是否可以开GP票
     * 0/null - 不可开
     * 1 - 可开
     * 2 - 仅开
     */
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Integer gpMode;


    /**
     * 用于前端判断登录是否成功
     */
    public String getStatus() {
        return this.getErrcode() == 0 ? "OK": "ER";
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getFullName() {
        return fullName;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }

    public Integer getEnterpriseId() {
        return enterpriseId;
    }

    public void setEnterpriseId(int enterpriseId) {
        this.enterpriseId = enterpriseId;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public String getToken() {
        return token;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public Integer getUserId() {
        return userId;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Date getExpireDate() {
        return expireDate;
    }

    public void setExpireDate(Date expireDate) {
        this.expireDate = expireDate;
    }

    public Integer getExpireDays() {
        return expireDays;
    }

    public void setExpireDays(Integer expireDays) {
        this.expireDays = expireDays;
    }

    public String getSid() {
        return sid;
    }

    public void setSid(String sid) {
        this.sid = sid;
    }

    public Integer getGpMode() {
        return gpMode;
    }

    public void setGpMode(int gpMode) {
        this.gpMode = gpMode;
    }
}
